import requests

# 下载图片
url = 'https://ziyuan.guwendao.net/authorImg300/libai.jpg'
res = requests.get(url)
# print(res.content)
with open('tupian.jpg', 'wb') as f:
    f.write(res.content)